﻿using DataSetMerge.Mergers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;

namespace Mix
{
    class Program
    {
        

        static void Main(string[] args)
        {
            WixHarvestMerger merger = new WixHarvestMerger();
            XElement target;
            XElement source;
            string file1;
            string file2;
            string output = string.Empty;

            if (args.Length == 0) return;
            else
            {
                file1 = args[0].Trim('"');
                file2 = args[1].Trim('"');

                for (int i = 0; i < args.Length; i++)
                {
                    var curr = args[i];

                    switch (curr)
                    {
                        case "-out":
                            output = args[i + 1].Trim('"');
                            break;
                        default:
                            continue;
                    }
                }
            }

            target = XElement.Load(file1);
            source = XElement.Load(file2);

            merger.MergeData(target, source);

            target.Save(file1);
        }
    }
}
